pull: Prioritize fetching metadata objects over content objects
authorMatthew Barnes <mbarnes@redhat.com>
Thu, 8 Jan 2015 19:11:12 +0000 (14:11 -0500)
committerMatthew Barnes <mbarnes@redhat.com>
Sun, 11 Jan 2015 23:48:21 +0000 (18:48 -0500)
src/libostree/ostree-repo-pull.c

index 296d23ebf25da4067ffc635b2cf6c41d8e51f5c3..efe87f6720c4661dc3a34714641dd7a4366bb4c2 100644 (file)
@@ -29,6 +29,9 @@
 #include "ostree-metalink.h"
 #include "otutil.h"
 
+#define OSTREE_REPO_PULL_CONTENT_PRIORITY  (OSTREE_FETCHER_DEFAULT_PRIORITY)
+#define OSTREE_REPO_PULL_METADATA_PRIORITY (OSTREE_REPO_PULL_CONTENT_PRIORITY - 100)
+
 typedef struct {
   OstreeRepo   *repo;
   OstreeRepoPullFlags flags;
@@ -1123,7 +1126,8 @@ enqueue_one_object_request (OtPullData        *pull_data,
 
   _ostree_fetcher_request_uri_with_partial_async (pull_data->fetcher, obj_uri,
                                                   expected_max_size,
-                                                  OSTREE_FETCHER_DEFAULT_PRIORITY,
+                                                  is_meta ? OSTREE_REPO_PULL_METADATA_PRIORITY
+                                                          : OSTREE_REPO_PULL_CONTENT_PRIORITY,
                                                   pull_data->cancellable,
                                                   is_meta ? meta_fetch_on_complete : content_fetch_on_complete, fetch_data);
   soup_uri_free (obj_uri);